﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true"
    CodeBehind="Tinhtrangdonhang.aspx.cs" Inherits="TPCN.Tinhtrangdonhang" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="App_Themes/Default/gridview-shoppingcart.css" rel="stylesheet" type="text/css" />
    <link href="App_Themes/Admincp/forms.css" rel="stylesheet" type="text/css" />
    <link href="App_Themes/Admincp/messages.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <div class="box">
        <div class="boxtitle">
            Đơn đặt hàng của bạn
        </div>
        <div class="boxcontent padding20">
            <asp:GridView ID="gridOrder" runat="server" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" Width="100%" DataKeyNames="DondathangID" CssClass="gridview"
                AlternatingRowStyle-CssClass="even" BorderStyle="None" OnRowCommand="gridOrder_RowCommand"
                OnPageIndexChanging="gridOrder_PageIndexChanging">
                <AlternatingRowStyle CssClass="even"></AlternatingRowStyle>
                <Columns>
                    <asp:TemplateField HeaderText="Mã đơn đặt hàng">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("DondathangID") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ngày đặt">
                        <ItemTemplate>
                            <asp:Label ID="lblNgaylap" runat="server" Text='<%# FormatDate(Eval("Ngaylap")) %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tình trạng">
                        <ItemTemplate>
                            <asp:Label ID="lblStatus" runat="server" Text='<%# GetStatus(Eval("DondathangID")) %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="btnChitiet" runat="server" CommandName="cmdChitiet" CommandArgument='<%# Eval("DondathangID") %>'
                                Text="Chi tiết" />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Panel ID="chitietDDH" runat="server">
                <asp:GridView ID="ChitietdondathangGridView" runat="server" AutoGenerateColumns="False"
                    Width="100%" DataKeyNames="ChitietDondathangID" AllowPaging="True" CssClass="gridview"
                    AlternatingRowStyle-CssClass="even" PageSize="15" OnPageIndexChanging="ChitietdondathangGridView_PageIndexChanging">
                    <AlternatingRowStyle CssClass="even" />
                    <Columns>
                        <asp:BoundField DataField="HangID" HeaderText="Mã hàng" ReadOnly="True">
                            <HeaderStyle CssClass="hide" />
                            <ItemStyle CssClass="hide" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Tên hàng">
                            <ItemTemplate>
                                <asp:Literal ID="lblProductName" runat="server" Text='<%# GetProductNameFromID(Eval("HangID")) %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Soluong" HeaderText="Số lượng" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="Ghichu" HeaderText="Ghi chú"></asp:BoundField>
                    </Columns>
                    <HeaderStyle HorizontalAlign="Left" />
                    <PagerSettings FirstPageText="Đầu" LastPageText="Cuối" Mode="NumericFirstLast" NextPageText="Tiếp"
                        PreviousPageText="Trước" PageButtonCount="5" />
                    <PagerStyle CssClass="pgr" />
                </asp:GridView>
                <div class="backButton clear">
                    <asp:Button ID="btnBack" runat="server" CssClass="button button-green" Text="Trở lại" Visible=false
                        OnClick="btnBack_Click" />
                </div>
            </asp:Panel>
        </div>
    </div>
</asp:Content>
